const inquirer = require("inquirer");

inquirer
  .prompt([
      {
          type: "expand",// input支持简写方式 并规范只能输入其一
          name: "choice",// 必传  作为键值对中key出现
          message: "your choice",
          default: "green",
          choices: [
            {key: "R", value: "red"},
            {key: "Y", value: "yellow"},
            {key: "G", value: "green"},
          ]
      },
  ])
  .then((answers) => {
      console.log(answers);
    // Use user feedback for... whatever!!
  })
  .catch((error) => {
    if (error.isTtyError) {
      // Prompt couldn't be rendered in the current environment
    } else {
      // Something else went wrong
    }
  });
